Add StreamFile(s)Param decorators#102
Open
blocosted wants to merge 8 commits into
Open
Conversation
Collaborator
|
@tchambard this all looks good to me. Do you know why this is breaking travisCI? |
tnrich
requested changes
Feb 21, 2020
| description: this.getParameterDescription(parameter), | ||
| in: 'formData', | ||
| name: getDecoratorTextValue(this.parameter, ident => ident.text === 'FilesParam') || parameterName, | ||
| name: getDecoratorTextValue(this.parameter, ident => ident.text === 'FilesParam' || ident.text === 'StreamFilesParam') || parameterName,======= |
Collaborator
There was a problem hiding this comment.
@tchambard looks like this line has a bunch of ======= signs added to the end of it. I assume by accident?
Collaborator
There was a problem hiding this comment.
That's what is probably breaking the CI tests
Contributor
Author
There was a problem hiding this comment.
Thanks @tnrich I fixed it.
Indeed it was a mitake...
8b83a52 to
cb45ed9
Compare
# Conflicts: # src/metadata/parameterGenerator.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to be able to pipe the request in express handlers implementations (stream) instead of using multer like typescript-rest is doing with FileParam decorator, the new StreamFileParam decorator will generate the correct swagger button for uploading binary file.
I just added some unit tests for @FileParam and @StreamFileParam parameters.
So, the difference between @FileParam and @StreamFileParam is simple.
@FileParam is interpreted by typescript-rest module as a Multer file element, and the content of the multipart request is consumed by the Http server.
With @StreamFileParam, nothing is done, and you still have the chance to pipe your request to another Http server in order to process streaming...
See #47 for previous comments